<?php
/**
 * Created by PhpStorm.
 * User: waw
 * Date: 2019/6/22
 * Time: 0:52
 */

if ($_SERVER["REQUEST_METHOD"] == "GET") {
    print_r(json_encode(array("msg" => "不能发送get", "status" => 4)));
    return;
}

session_start();
if (!isset($_SESSION["registor"])) {
    print_r(json_encode(array("msg" => "请登录", "status" => 3)));
    return;
}

$cid = $_REQUEST["cid"];

include "./DBhelper.php";
$update = "DELETE FROM cartlists WHERE  c_id='" . $cid . "'";

$uReulst = sqlQuery($update); //执行语句
if ($uReulst == 1) {
    print_r(json_encode(array("msg" => "deleted", "status" => 1)));
} else {
    print_r(json_encode(array("msg" => "schonFertig", "status" => 2)));
}
